# 简单的 HTTP 服务器
import socketserver
import http.server
PORT = 8000 
handler = http.server.SimpleHTTPRequestHandler 
with socketserver.TCPServer(("", PORT), handler) as http: 
    print("Server Launch at Localhost: " + str(PORT)) 
    http.serve_forever()

# 也可以在终端直接执行一下命令
# python3 -m http.server 8000